package com.dangf.app.launcher.app

import com.dangf.app.launcher.entity.Advert
import com.dangf.app.launcher.entity.Machine
import com.dangf.app.launcher.entity.Soft
import com.dangf.app.launcher.entity.Store
import pw.hais.utils_lib.utils.SPUtils

/**
 * Created by 管理员 on 2017/9/12.
 */
object V {
    var mMachine: Machine? = null                 //机器信息
    var mStore: Store? = null                     //商店信息
    var mAdvert: Advert? = null                   //公告信息
    var mAppList: MutableList<Soft> = arrayListOf()           //应用列表
    var mSystemAppList: MutableList<Soft> = arrayListOf()     //管理列表


    val SERVER_ADDRESS = SPUtils.getObject(SP.SP_SERVER_ADDRESS,String::class.java,"")      //服务器地址
    val HTTP_SERVER_PORT = SPUtils.getObject(SP.SP_HTTP_SERVER_PORT, Int::class.java, 0)     //服务器地址
    val SOCKECT_SERVER_PORT = SPUtils.getObject(SP.SP_SOCKECT_SERVER_PORT, Int::class.java, 0)

    val HTTP_SERVER_URL = "http://$SERVER_ADDRESS:$HTTP_SERVER_PORT/"
    val HTTP_API_URL = HTTP_SERVER_URL + "api?"
    val HTTP_FILE_URL = HTTP_SERVER_URL
    val SOCKECT_SERVER_URL = HTTP_SERVER_URL.replace("http://", "").replace("/", "").replace(":8080", "")

    val URL_GET_STORE = HTTP_API_URL + "m=store&a=info"                 //获取商家信息
    val URL_REGISTER_MACHINE = HTTP_API_URL + "m=machine&a=register"    //注册机器
    val URL_GET_MACHINE = HTTP_API_URL + "m=machine&a=info"             //获取机器信息
    val URL_GET_SOFTS = HTTP_API_URL + "m=soft&a=all"                   //获取机器信息
    val URL_GET_ADVERT_LAST = HTTP_API_URL + "m=advert&a=last"             //获取机器信息
}